﻿using System;
using System.Reflection;
public class Person
{
    public string Name { get; set; }
    public int Age { get; set; }

    public Person(string name, int age)
    {
        Name = name;
        Age = age;
    }

    public void DisplayInfo()
    {
        Console.WriteLine($"Name: {Name}, Age: {Age}");
    }
}

class Program
{
    static void Main()
    {
        Type personType = typeof(Person);

        ConstructorInfo constructor = personType.GetConstructor(new Type[] { typeof(string), typeof(int) });

        if (constructor != null)
        {
            object[] parameters = { "John Doe", 30 };

            object personObj = constructor.Invoke(parameters);

            MethodInfo displayInfoMethod = personType.GetMethod("DisplayInfo");
            displayInfoMethod.Invoke(personObj, null);
        }
        else
        {
            Console.WriteLine("Constructor not found.");
        }
    }
}
